package com.ruoyi.buss.qmcy.controller;

import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.common.security.annotation.PreAuthorize;
import com.ruoyi.buss.qmcy.domain.QmcyCustPersonalInfo;
import com.ruoyi.buss.qmcy.service.IQmcyCustPersonalInfoService;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.utils.poi.ExcelUtil;
import com.ruoyi.common.core.web.page.TableDataInfo;

/**
 * 个人维度信息加工--大数据平台加工非常重要Controller
 * 
 * @author sxy
 * @date 2021-07-16
 */
@RestController
@RequestMapping("/personal")
public class QmcyCustPersonalInfoController extends BaseController
{
    @Autowired
    private IQmcyCustPersonalInfoService qmcyCustPersonalInfoService;

    /**
     * 查询个人维度信息加工--大数据平台加工非常重要列表
     */
    @PreAuthorize(hasPermi = "buss:personal:list")
    @GetMapping("/list")
    public TableDataInfo list(QmcyCustPersonalInfo qmcyCustPersonalInfo)
    {
        startPage();
        List<QmcyCustPersonalInfo> list = qmcyCustPersonalInfoService.selectQmcyCustPersonalInfoList(qmcyCustPersonalInfo);
        return getDataTable(list);
    }

    /**
     * 导出个人维度信息加工--大数据平台加工非常重要列表
     */
    @PreAuthorize(hasPermi = "buss:personal:export")
    @Log(title = "个人维度信息加工--大数据平台加工非常重要", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, QmcyCustPersonalInfo qmcyCustPersonalInfo) throws IOException
    {
        List<QmcyCustPersonalInfo> list = qmcyCustPersonalInfoService.selectQmcyCustPersonalInfoList(qmcyCustPersonalInfo);
        ExcelUtil<QmcyCustPersonalInfo> util = new ExcelUtil<QmcyCustPersonalInfo>(QmcyCustPersonalInfo.class);
        util.exportExcel(response, list, "个人维度信息加工--大数据平台加工非常重要数据");
    }

    /**
     * 获取个人维度信息加工--大数据平台加工非常重要详细信息
     */
    @PreAuthorize(hasPermi = "buss:personal:query")
    @GetMapping(value = "/{sjrq}")
    public AjaxResult getInfo(@PathVariable("sjrq") String sjrq)
    {
        return AjaxResult.success(qmcyCustPersonalInfoService.selectQmcyCustPersonalInfoById(sjrq));
    }

    /**
     * 新增个人维度信息加工--大数据平台加工非常重要
     */
    @PreAuthorize(hasPermi = "buss:personal:add")
    @Log(title = "个人维度信息加工--大数据平台加工非常重要", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody QmcyCustPersonalInfo qmcyCustPersonalInfo)
    {
        return toAjax(qmcyCustPersonalInfoService.insertQmcyCustPersonalInfo(qmcyCustPersonalInfo));
    }

    /**
     * 修改个人维度信息加工--大数据平台加工非常重要
     */
    @PreAuthorize(hasPermi = "buss:personal:edit")
    @Log(title = "个人维度信息加工--大数据平台加工非常重要", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody QmcyCustPersonalInfo qmcyCustPersonalInfo)
    {
        return toAjax(qmcyCustPersonalInfoService.updateQmcyCustPersonalInfo(qmcyCustPersonalInfo));
    }

    /**
     * 删除个人维度信息加工--大数据平台加工非常重要
     */
    @PreAuthorize(hasPermi = "buss:personal:remove")
    @Log(title = "个人维度信息加工--大数据平台加工非常重要", businessType = BusinessType.DELETE)
	@DeleteMapping("/{sjrqs}")
    public AjaxResult remove(@PathVariable String[] sjrqs)
    {
        return toAjax(qmcyCustPersonalInfoService.deleteQmcyCustPersonalInfoByIds(sjrqs));
    }
}
